<?php


namespace app\model\config;


use think\Model;
use think\model\concern\SoftDelete;

class RecycleModel extends Model
{
    protected $name = 'recycle';
    protected $autoWriteTimestamp = true;

    use SoftDelete;
    protected $defaultSoftDelete = 0;

    protected $append = ['type_txt'];

    protected $typeArr = [
        1 => '驾校',
        2 => '学车教练',
        3 => '陪驾教练',
    ];

    public function getTypeTxtAttr($value, $data)
    {
        if (!isset($data['type'])) {
            return '';
        }
        return $this->typeArr[$data['type']] ?? '';
    }
}